package ${packageName};

import javax.validation.Valid;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import me.helllp.bootman.common.base.BaseReturn;
import ${basePackage}.vo.*;

/**
 * ${memo}
 * 
 * @author 自动生成
 *
 */
@RestController
@RequestMapping("${rootUrl}")
@Api("${memo}")
public class ${identify}Controller extends me.helllp.bootman.common.base.BaseController{
	private static final Logger logger = LoggerFactory.getLogger(${identify}Controller.class);
	
	@Autowired
	private ${serviceImpl} logicService;
	
<#list nodeList as node>
	/**
	 * ${node.memo}
	 */
	@ApiOperation("${node.memo}") 
	@RequestMapping(value = "${node.url}", method=RequestMethod.${node.httpMethod})
	public BaseReturn run${node.methodName}(@Valid @RequestBody ${node.methodName}Input input, BindingResult result){
		if (result.hasErrors()) {
			BaseReturn ret = this.genCheckResult(result);
			logger.info(ret.toString());
			return ret;
		}	
		
		return logicService.logic${node.methodName}(input);
	}
	  
</#list>      
}
